<#include "/java_copyright.include">
<#assign className=table.className>
<#assign classNameLower=className?uncap_first>

package ${basepackage}.service;

import ${basepackage}.domain.${className};
import com.linln.common.enums.StatusEnum;
import com.github.pagehelper.PageInfo;
import java.util.List;

public interface ${className}Service extends GenericIService<${className},Long>{

    /**
     * 通过主键查询实体对象
     *
     * @param primaryKey
     * @return
     * @throws Exception
     */
    public ${className} getByPK(java.lang.Long primaryKey) ;

    /**
     * 查询所有记录
     * @return
     * @throws Exception
     */
    public List<${className}> list() ;

    /**
     * 根据查询条件查询所有记录
     * @return
     * @throws Exception
     */
    public List<${className}> listByProperty(${className} ${classNameLower}) ;


    /**
     * 根据主键删除记录
     * @param primaryKey
     * @return
     * @throws Exception
     */
    public int deleteByPK(java.lang.Long primaryKey) ;

    /**
     * 根据多个主键删除记录
     * @param primaryKeys
     * @throws Exception
     */
    public int deleteByPKeys(List<java.lang.Long>primaryKeys) ;

    /**
     * 根据传入参数删除记录
     * @param ${classNameLower}
     * @return
     * @throws Exception
     */
    public int deleteByProperty(${className} ${classNameLower}) ;

    /**
     * 保存记录
     * @param ${classNameLower}
     * @return
     * @throws Exception
     */
    public int save(${className} ${classNameLower}) ;

    /**
     * 更新记录
     * @param ${classNameLower}
     * @return
     * @throws Exception
     */
    public int update(${className} ${classNameLower}) ;

    /**
     * 根据条件查询记录条数
     * @param ${classNameLower}
     * @return
     * @throws Exception
     */
    public int findByCount (${className} ${classNameLower}) ;

    /**
     * 根据查询条件查询分页记录
     * @return
     * @throws Exception
     */
    public PageInfo<${className}> findByPage(Integer pageNum, Integer pageSize, ${className} ${classNameLower});

<#assign hasStatusField = false>
<#list table.columns as column>
    <#if column.sqlName?? &&  'status' == column.sqlName>
        <#assign hasStatusField = true>
    </#if>
</#list>
<#if hasStatusField>
    boolean updateStatus(StatusEnum statusEnum, List<Long> ids);
</#if>
}
